<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: red;
            /* animation: mymove2 5s ease-in-out 2s infinite alternate; */
            /* 
            mymove      动画名称
            5s          动画一次循环所需时间
            ease-in-out 加速然后减速 (linear 匀速)
            2s          动画延迟时间
            infinite    无限循环
            alternate   在循环中正向反向互切换（看不懂自己试）
            */


            animation-name: mymove1;
            animation-duration: 1s;
            animation-timing-function: linear;
            animation-delay: 0s;
            animation-iteration-count: infinite;

            animation-play-state: running;
            /*  默认 running
                paused  暂停  */
            animation-direction: alternate-reverse;
            /* 
            normal  正常
            reverse 反方向
            alternate   正常方向-交替
            alternate-reverse   反方向-交替
            */
        }

        div:hover{
            animation-play-state: paused;
        }
        /* 声明动画 */
        @keyframes mymove1 {
            from{
                width: 200px;
                height: 200px;
                background-color: black;
            }
            to{
                width: 400px;
                height: 600px;
                background-color: wheat;
            }
        }
        @keyframes mymove2 {
            0%{
                width: 200px;
                height: 200px;
                background-color: red;
            }
            25%{
                width: 200px;
                height: 400px;
                background-color: yellow;
            }
            50%{
                width: 400px;
                height: 400px;
                background-color: blue;
            }
            75%{
                width: 400px;
                height: 500px;
                background-color: gray;
            }
            100%{
                width: 600px;
                height: 600px;
                background-color: green;
            }
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>